package com.cskaoyan.app.advice;

import com.cskaoyan.app.bean.common.BaseRespVo;
import com.cskaoyan.app.exception.ValidationException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ValidationAdvice {

    @ExceptionHandler(ValidationException.class)
    public BaseRespVo<Object> paramInvalidResolve(ValidationException e) {
        return BaseRespVo.invalidParameter(e.getMessage());
    }
}
